#include <stdio.h>
#include <unistd.h>
#include <string.h>
#include <stdlib.h>

int un_g_val;

int g_val=100;


int main(int argc,char* arv[])
{
  printf("text:%p\n",main);        //代码区
  printf("init:%p\n",&g_val);      //已初始化全局数据区
  printf("uninit:%p\n",&un_g_val); //未初始化全局数据区

  char* p=(char*)malloc(16);       //在堆上开辟空间

  printf("heap: %p\n",p);          //堆地址

  printf("stack: %p\n",&p);       //栈地址

  return 0;
}
